Skip to content

feat: add persistent thread rename and sidebar "Rename" action#108

Merged
Dimillian merged 3 commits intomainfrom
codex/github-mention-feat-add-rename-option-to-thread-context
Jan 19, 2026
Merged

feat: add persistent thread rename and sidebar "Rename" action#108
Dimillian merged 3 commits intomainfrom
codex/github-mention-feat-add-rename-option-to-thread-context

Conversation

@Dimillian
Copy link
Owner

Motivation

  • Users need to assign meaningful names to threads instead of the auto-generated Agent X/ID-based names to easily identify threads by topic.
  • Custom names must persist across restarts and survive listing/pagination/resume flows without being clobbered by streaming updates.
  • Avoid passing external storage state into the reducer by using a heuristic to protect custom names from automated renames.

Description

  • Added localStorage-backed custom name persistence with caching: introduced STORAGE_KEY_CUSTOM_NAMES, makeCustomNameKey, loadCustomNames, saveCustomName, and a cached customNamesRef + getCustomName in useThreads to avoid repeated reads. (file: src/features/threads/hooks/useThreads.ts)
  • Applied custom-name priority in thread name resolution across listThreadsForWorkspace, loadOlderThreadsForWorkspace, and resumeThreadForWorkspace so cached custom names are used before backend preview or fallback names; and skip setting preview-based name when a custom name exists. (file: src/features/threads/hooks/useThreads.ts)
  • Exposed a renameThread callback from useThreads that writes to localStorage, updates the cache, and dispatches setThreadName. (file: src/features/threads/hooks/useThreads.ts)
  • Added a Rename menu item to the thread context menu and wired a prompt-based handler in App.tsx that calls renameThread; passed handler through useSidebarMenus -> Sidebar -> layout nodes. (files: src/features/app/hooks/useSidebarMenus.ts, src/features/app/components/Sidebar.tsx, src/features/layout/hooks/useLayoutNodes.tsx, src/App.tsx)
  • Heuristic guard to protect custom names: added looksAutoGeneratedThreadName and used it in maybeRenameThreadFromAgent and the inline rename logic so auto-renames only run when the current name appears auto-generated. (file: src/features/threads/hooks/useThreadsReducer.ts)
  • Key details: storage keys use workspaceId:threadId to avoid collisions across workspaces, parsing/writes are best-effort (try/catch) and invalid JSON is ignored.

Testing

  • Ran npm run lint which completed (note: eslint emitted a TypeScript-version warning about TS 5.8.3 vs supported range).
  • Ran npm run typecheck (tsc --noEmit) and it completed without errors.
  • No UI screenshot tests were run in this environment; manual UX behaviors expected by the change are documented in the PR checklist (prompt, persistence, and rename protection).

Codex Task

@Dimillian
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 066b19fe33

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian Dimillian merged commit 536d608 into main Jan 19, 2026
2 checks passed
gersmann pushed a commit to gersmann/codex-monitor-web that referenced this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant